package com.example.game.sdk.framework.contract

import android.app.Activity
import android.content.Intent
import android.content.res.Configuration
import android.os.Bundle
import android.view.KeyEvent


interface ActivityLifecycleContract {

    fun onCreate(activity: Activity,savedInstanceState: Bundle?)


    fun onStart(activity: Activity)


    fun onResume(activity: Activity)


    fun onPause(activity: Activity)


    fun onStop(activity: Activity)


    fun onDestroy(activity: Activity)


    fun onRestart(activity: Activity)


    fun onActivityResult(activity: Activity,requestCode: Int, resultCode: Int, data: Intent?)

    fun onRequestPermissionsResult(
        activity: Activity,
        requestCode: Int,
        permissions: Array<out String?>,
        grantResults: IntArray
    )

    fun onConfigurationChanged(activity: Activity,newConfig: Configuration)

    /**
     *
     * 处理返回键事件，实现层可通过返回 true 拦截返回键，返回 false 让系统处理。
     * （理论上只有渠道插件有可能需要拦截）
     * @return 返回 true 表示拦截返回键，返回 false 表示让系统处理。
     */
    fun onBackPressed(activity: Activity): Boolean

    /**
     * 处理按键事件（理论上只有渠道插件有可能需要拦截）
     */
    fun onKeyDown(activity: Activity,keyCode: Int, event: KeyEvent?): Boolean


}